package org.example.wu_and_dian.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 用于存储关系类的信息
 * @TableName relation_class
 */
@TableName(value ="relation_class")
@Data
public class RelationClass implements Serializable {
    /**
     * 唯一标识符
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 
     */
    private String eName;

    /**
     * 关系的名称
     */
    private String name;

    /**
     * 关系的描述
     */
    private String description;

    /**
     * 关系的路径
     */
    private String path;

    /**
     * 源实体
     */
    private Integer sourceEntity;

    /**
     * 目标实体
     */
    private Integer targetEntity;

    /**
     * 
     */
    private Integer urid;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        RelationClass other = (RelationClass) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getEName() == null ? other.getEName() == null : this.getEName().equals(other.getEName()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getPath() == null ? other.getPath() == null : this.getPath().equals(other.getPath()))
            && (this.getSourceEntity() == null ? other.getSourceEntity() == null : this.getSourceEntity().equals(other.getSourceEntity()))
            && (this.getTargetEntity() == null ? other.getTargetEntity() == null : this.getTargetEntity().equals(other.getTargetEntity()))
            && (this.getUrid() == null ? other.getUrid() == null : this.getUrid().equals(other.getUrid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getEName() == null) ? 0 : getEName().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getPath() == null) ? 0 : getPath().hashCode());
        result = prime * result + ((getSourceEntity() == null) ? 0 : getSourceEntity().hashCode());
        result = prime * result + ((getTargetEntity() == null) ? 0 : getTargetEntity().hashCode());
        result = prime * result + ((getUrid() == null) ? 0 : getUrid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", eName=").append(eName);
        sb.append(", name=").append(name);
        sb.append(", description=").append(description);
        sb.append(", path=").append(path);
        sb.append(", sourceEntity=").append(sourceEntity);
        sb.append(", targetEntity=").append(targetEntity);
        sb.append(", urid=").append(urid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}